clear all
program drop _all
set more off
set mem 600m

cd "C:\Users\master\Dropbox\Research\mexican_repatriates2\data\kwan"
use "D:\raw\1910.dta"

keep if age>=18 & age<=65

keep statefip county bpl fbpl mbpl

replace county = (1000*statefip) + (county/10)

gen mex=0
replace mex=1 if bpl==200 | fbpl==200 | mbpl==200

collapse (sum) mex_pop10=mex, by(county)

*replace county=41061 if county==41060.5

save mex_pop1910.dta, replace
